Skip to content

fix: build better-sqlite3 native addon so backend can start#65

Merged
yumike merged 1 commit into
mainfrom
fix/better-sqlite3-build-opt-in
Jun 19, 2026
Merged

fix: build better-sqlite3 native addon so backend can start#65
yumike merged 1 commit into
mainfrom
fix/better-sqlite3-build-opt-in

Conversation

@yumike

@yumike yumike commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Problem

The Backstage catalog renders empty and every /api/catalog/* request 404s. Root cause: the backend never finishes starting. /.backstage/health/v1/readiness returns 503 "Backend has not started yet" (liveness stays ok).

Yarn 4 disables package build scripts by default, so better-sqlite3's native addon (better_sqlite3.node) is never compiled. The in-memory SQLite client then fails with Could not locate the bindings file, catalog-backend init throws, backend.start() hangs, and no plugin routes mount — so the frontend can't fetch entities.

Fix

Opt better-sqlite3 into building via dependenciesMeta in the root package.json. On yarn install the addon compiles (node_modules/better-sqlite3/build/Release/better_sqlite3.node).

Verification

After the fix, the backend boots fully: Plugin initialization complete … 'catalog', DB migration runs, /api/catalog/entities returns 200, and the search collator indexes both software-catalog and the rwdocs.org/ref-annotated entity.

🤖 Generated with Claude Code

Yarn 4 disables package build scripts by default, so better-sqlite3's
native addon was never compiled. Without better_sqlite3.node the backend's
SQLite database client fails ("Could not locate the bindings file"),
catalog-backend initialization throws, backend.start() never completes, and
every /api/catalog/* route 404s — surfacing as an empty catalog in the UI
(readiness stays 503 "Backend has not started yet").

Opt better-sqlite3 into building via dependenciesMeta so the addon compiles
on install.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yumike yumike merged commit 46ca820 into main Jun 19, 2026
1 check passed
@yumike yumike deleted the fix/better-sqlite3-build-opt-in branch June 19, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant